Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

deFont.hpp

Go to the documentation of this file.
00001 ///////////////////////////////////////////////////////////////////////////////
00002 /// @file deFont.hpp
00003 ///
00004 /// @brief class for text display
00005 ///
00006 /// @author Lightning, Assassin
00007 ///
00008 /// This file is the intellectual property of Novus Delta, LLC.. Usage of the
00009 /// contents of this file is subject to the Destiny3D Member License which
00010 /// can be found at http://www.destiny3d.com.  Any other usage is prohibited.
00011 ///
00012 /// This file is distributed "AS IS" without warranty of any kind.  Novus
00013 /// Delta, LLC. does not guarantee the fitness of the contents of this file
00014 /// for any particular purpose.
00015 ///
00016 /// Copyright (C) 2001-2003 Novus Delta, LLC. All Rights Reserved.
00017 ///
00018 /// <hr>
00019 ///                                 Change History
00020 /// <hr>
00021 ///
00022 /// @date Jan 2002
00023 /// @author Lightning
00024 /// @remarks Creation
00025 ///
00026 /// @date Feb 2002
00027 /// @author Assassin
00028 /// @remarks Cleanup and modifications
00029 ///
00030 ///////////////////////////////////////////////////////////////////////////////
00031 
00032 #ifndef DEFONT_HPP
00033 #define DEFONT_HPP
00034 
00035 #include "de2D.hpp"
00036 #include "deGlobalTypes.hpp"
00037 
00038 #define DEFONT_API DE2D_API
00039 
00040 class IdeFont;
00041 
00042 // factory functions
00043 /// create an instance of IdeFont
00044 DEFONT_API IdeFont* IdeFont_CreateFont();
00045 
00046 /// Used to create and render text onto a graphics device, in 2D or 3D.
00047 /// Related functions: IdeFont_CreateFont.
00048 /// Related classes: Ide2DObject.
00049 //class IdeFont
00050 DE3D_INTERFACE_(IdeFont)
00051 {
00052 public:
00053     /// values for use in SetFont method
00054     enum FontStyleFlag_t
00055     {
00056         STYLE_DEFAULT       =0,             ///< default (plain) font
00057         STYLE_BOLD          =(0x00000001),  ///< bold font
00058         STYLE_ITALIC        =(0x00000002),  ///< italic font
00059         STYLE_UNDERLINE     =(0x00000004),  ///< underlined font
00060         STYLE_STRIKEOUT     =(0x00000008),  ///< strikeout font
00061         STYLE_FORCE32BIT    =(0x7fffffff)
00062     };
00063     /// values for use in Print2D, Print3D methods
00064     enum FontPosFlag_t
00065     {
00066         POSITION_TOP        =(0x00000002),  ///< text has its highest point at specified coordinate
00067         POSITION_LEFT       =(0x00000004),  ///< text is left-justified to specified coordinate
00068         POSITION_BOTTOM     =(0x00000008),  ///< text has its lowest point at specified coordinate
00069         POSITION_RIGHT      =(0x00000010),  ///< text is right-justified to specified coordinate
00070         POSITION_HCENTER    =(0x00000020),  ///< text is center-justified to specified coordinate
00071         POSITION_VCENTER    =(0x00000040),  ///< text is vertically centered around specified coordinate
00072         POSITION_DEFAULT    =(POSITION_TOP | POSITION_LEFT),
00073         POSITION_PERCENT    =(0x00000080),  ///< position is specified in percentage of screen, not pixel coordinate
00074         POSITION_FORCE32BIT =(0x7fffffff)
00075     };
00076 protected:
00077     //constructors/destructor
00078     virtual ~IdeFont() {}
00079 public:
00080     /// instant destruction of this object
00081     virtual int Release() = 0;
00082     
00083     //functions to modify the font
00084     /// Set the current font settings
00085     /// @param Font A character string specifying a system-font name (ie "Arial")
00086     /// @param Height The point height of the font
00087     /// @param FontFlags A combination of flags specified for font style
00088     virtual deBoolean SetFont(const char *Font, long Height, long StyleFlags) = 0;
00089     /// currently not implemented
00090     virtual deBoolean SetFont(IdeBitmapProxy *Font, long Height, long *Widths) = 0;
00091     
00092     //functions to change 1 font setting at a time
00093     /// Set the color of the font.
00094     /// Specify a color with alpha < 255 to have a translucency in the opaque sections of text.
00095     virtual deBoolean SetColor(deARGB Color) = 0;
00096     
00097     //allow scaling of a font so 1 font can be set but used for multiple sizes
00098     virtual deBoolean SetScale(deDouble Scale) = 0;
00099     
00100     //print 2d text
00101     virtual deFloat GetStringWidth(char * String) = 0;
00102     virtual deFloat GetStringHeight(char * String) = 0;
00103     /// Print text into a 2D object, which can be rendered through Ide2DCollection.
00104     /// You can obtain the top-level Ide2DCollection from IdeRender::Get2DCollection
00105     virtual Ide2DObject * Print2D(IdeDriver * Driver, deRect *ClipRect, deDouble X, deDouble Y, deDouble Depth, int *StringWidth, int *StringHeight, int DisplayFlags, const char *Format, ...) = 0;
00106     
00107     //print 3d text
00108     /// currently not implemented
00109     virtual deBoolean Print3D(deVertex *Position, deVertex *Rotation, deDouble Depth, int DisplayFlags, const char *Format, ...) = 0;
00110     
00111 };
00112 
00113 #endif

Generated on Mon Sep 12 19:58:27 2005 for Destiny3D by doxygen1.3-rc3